from pymongo import Connection

connection = Connection("localhost")

db = connection.enviromental_data

data = db.control.find_one({"label":0})

print data["power"]

"""
from XW_Inverter import XW_Inverter

PORT = '/dev/tty.usbserial-FTUTUPP2'
ADDRESS = [0x65, 0x89, 0xc3, 0x80]

Inverter = XW_Inverter(PORT, ADDRESS[0])
Inverter.serial.timeout = 0.25

def startInvert():
    for i in range(0,4):
        Inverter.address = ADDRESS[i]
        Inverter.setInvertStat(1)

def stopInvert():
    for i in range(0,4):
        Inverter.address = ADDRESS[i]
        Inverter.setInvertStat(0)
"""